InsetRgn
InsetRgn
Shrink or expand a region, retaining current shape void InsetRgn(theRgn, distHoriz, distVert ); RgnHandle theRgn ; handle of region to modify short distHoriz ; >0 = shrink horizontally; <0 = expand
short distVert ; >0 = shrink vertically; <0 = expand
InsetRgn expands or shrinks the size of a region, horizontally, vertically, or in both directions.
theRgn is the handle of an existing region. Upon return, the structure of
the region will be modified.
distHoriz is the distance, in pixels, to expand or shrink the region
horizontally. Positive values shrink; negative values expand.
distVert is the distance, in pixels, to expand or shrink the region vertically.
Positive values shrink; negative values expand.
Notes: InsetRgn modifies the region's structure by applying distHoriz and distVert to all coordinates within its definition data. The region is shrunk
(or expanded) toward (or away from) its center.
The region retains its general shape, scaled to match the changed
coordinates. Note that if the region is composed of two outlines, the inset is
applied to each, individually. Figure A is a region composed of two
identical overlapping ovals. Figure B, is that same region inset by 5
pixels in each direction.
Figure C is the result of expanding Figure B by 5 pixels (inset by
-5,-5). It illustrates another significant point: information can be lost
when a region is shrunk, then expanded.
Use MapRgn to change a region's size while retaining all of its shape-definition information.